package com.bestcem.xm.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 个人首页枚举
 *
 * @author panyun <yun.pan@idiaoyan.com>
 * @version v1.0
 * @date 2022/3/2 14:14
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum UserUserIndexEnum {

    /**
     * 个人首页枚举
     */
    QUESTIONNAIRE_ITEMS(0, "问卷项目"),
    TICKET_RECORD(1, "工单记录"),
    DASH_BOARD(2, "仪表盘"),
    ENTERPRISE_MANAGEMENT(3, "企业管理"),
    CUSTOMER_JOURNEY(4, "客户旅程");

    /**
     * 状态
     */
    private Integer type;
    /**
     * 状态描述
     */
    private String desc;

    /**
     * 通过type获取
     *
     * @param type
     * @return
     */
    public static UserUserIndexEnum getByType(Integer type) {
        if (type != null) {
            for (UserUserIndexEnum value : values()) {
                if (value.getType().equals(type)) {
                    return value;
                }
            }
        }
        return null;
    }
}
